package com.imc.beans;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * UpdateListId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class UpdateListId implements java.io.Serializable {

	// Fields

	private String product;
	private String version;
	private String lastVersion;
	private String url;
	private String note;

	// Constructors

	/** default constructor */
	public UpdateListId() {
	}

	/** minimal constructor */
	public UpdateListId(String lastVersion) {
		this.lastVersion = lastVersion;
	}

	/** full constructor */
	public UpdateListId(String product, String version, String lastVersion,
			String url, String note) {
		this.product = product;
		this.version = version;
		this.lastVersion = lastVersion;
		this.url = url;
		this.note = note;
	}

	// Property accessors

	@Column(name = "product", unique = true, length = 64)
	public String getProduct() {
		return this.product;
	}

	public void setProduct(String product) {
		this.product = product;
	}

	@Column(name = "version", length = 64)
	public String getVersion() {
		return this.version;
	}

	public void setVersion(String version) {
		this.version = version;
	}

	@Column(name = "last_version", nullable = false, length = 64)
	public String getLastVersion() {
		return this.lastVersion;
	}

	public void setLastVersion(String lastVersion) {
		this.lastVersion = lastVersion;
	}

	@Column(name = "url", length = 16777215)
	public String getUrl() {
		return this.url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	@Column(name = "note", length = 16777215)
	public String getNote() {
		return this.note;
	}

	public void setNote(String note) {
		this.note = note;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof UpdateListId))
			return false;
		UpdateListId castOther = (UpdateListId) other;

		return ((this.getProduct() == castOther.getProduct()) || (this
				.getProduct() != null && castOther.getProduct() != null && this
				.getProduct().equals(castOther.getProduct())))
				&& ((this.getVersion() == castOther.getVersion()) || (this
						.getVersion() != null && castOther.getVersion() != null && this
						.getVersion().equals(castOther.getVersion())))
				&& ((this.getLastVersion() == castOther.getLastVersion()) || (this
						.getLastVersion() != null
						&& castOther.getLastVersion() != null && this
						.getLastVersion().equals(castOther.getLastVersion())))
				&& ((this.getUrl() == castOther.getUrl()) || (this.getUrl() != null
						&& castOther.getUrl() != null && this.getUrl().equals(
						castOther.getUrl())))
				&& ((this.getNote() == castOther.getNote()) || (this.getNote() != null
						&& castOther.getNote() != null && this.getNote()
						.equals(castOther.getNote())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result
				+ (getProduct() == null ? 0 : this.getProduct().hashCode());
		result = 37 * result
				+ (getVersion() == null ? 0 : this.getVersion().hashCode());
		result = 37
				* result
				+ (getLastVersion() == null ? 0 : this.getLastVersion()
						.hashCode());
		result = 37 * result
				+ (getUrl() == null ? 0 : this.getUrl().hashCode());
		result = 37 * result
				+ (getNote() == null ? 0 : this.getNote().hashCode());
		return result;
	}

}